<template>
	<view class="certificationDetails" v-if="data.info">
		<view class="top">
			<image
				:src="data.info.auditState.value == 'PENDING'?'/static/img/index/68.png':data.info.auditState.value == 'APPROVED'?'/static/img/index/120.png':'/static/img/index/121.png'"
				mode="widthFix"></image>
			<text class="shz" :style="data.info.auditState.value == 'APPROVED'?'color:#6AC922;':data.info.auditState.value == 'REJECTED'?'color:#FF263E;':''">{{data.info.auditState.name}}</text>
			<text class="tj" v-if="data.info.auditState.value == 'PENDING'">您的开通店铺申请已提交</text>
			<text class="dd" v-if="data.info.auditState.value == 'PENDING'">平台将在7个工作日内审核，请耐心等待!</text>
			<view class="">
				<text>申请人：{{data.info.storeName}}</text>
				<text>申请时间:{{data.info.createTime}}</text>
			</view>
		</view>
		<view class="base">
			基础信息
			<view class="">
				<view class="">
					<text>基础信息</text>
					<text>{{data.info.mainType.name}}</text>
				</view>
				<view class="">
					<text>联系电话</text>
					<text>{{data.info.linkPhone}}</text>
				</view>
				<view class="">
					<text>地址</text>
					<text>{{data.info.addressDetail}}</text>
				</view>
				<view class="">
					<text>行业类目</text>
					<text>{{data.info.industryName}}</text>
				</view>
				<view class="">
					<text>客服信息</text>
					<text>{{data.info.servicePhone}}</text>
				</view>
				<view class="">
					<text>店铺介绍</text>
					<text>{{data.info.storeDesc}}</text>
				</view>
			</view>
		</view>
		<view class="qualifications">
			资质信息
			<view class="idCart">
				身份证
				<view class="bot">
					<view class="" v-if="data.info.certFrontFile">
						<view class="">
							<image :src="data.httpUrl+'/app/file/viewFile?fileId='+data.info.certFrontFile"
								mode="aspectFill"></image>
						</view>
						身份证人像面
					</view>
					<view class="" v-if="data.info.certBackFile">
						<view class="">
							<image :src="data.httpUrl+'/app/file/viewFile?fileId='+data.info.certBackFile"
								mode="aspectFill"></image>
						</view>
						身份证国徽面
					</view>
				</view>

			</view>
			<view class="yyzz" v-if="data.info.mainType.value == 'COMPANY'">
				营业执照({{data.info.licenceFile?1:0}}/1)
				<view class="">
					<image :src="data.httpUrl+'/app/file/viewFile?fileId='+data.info.licenceFile" mode="aspectFill">
					</image>
				</view>
			</view>
			<view class="xgzz" v-if="data.info.mainType.value == 'COMPANY'">
				相关资质({{data.info.otherLicence.length || 0}}/20)
				<view class="">
					<view class="" v-for="(item,index) in data.info.otherLicence" :key="index">
						<image :src="data.httpUrl+'/app/file/viewFile?fileId='+item" mode="aspectFill"></image>
					</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script setup lang="ts">
	import {
		onLoad
	} from '@dcloudio/uni-app'
	import { auditDetail } from '@/utils/api/shop'
	import { reactive } from 'vue';
	const data = reactive<any>({
		info: '',
		httpUrl: getApp().globalData.baseUrl,
	})
	onLoad(({ id }) => {
		auditDetail({ data: { applyId: id } }).then((res) => {
			res.data.otherLicence = JSON.parse(res.data.otherLicence)
			data.info = res.data;
		})
	})
</script>

<style lang="scss" scoped>
	.certificationDetails {
		min-height: 100vh;
		background: #F5F5F5;

		.qualifications {
			color: #8C8C8C;
			padding: 0 24rpx;
			margin-top: 24rpx;

			image {
				width: 100%;
				height: 100%;
			}

			.idCart {
				padding: 24rpx 32rpx;
				border-radius: 20rpx;
				background: #fff;
				margin-top: 20rpx;

				.bot {
					display: flex;
					justify-content: space-between;

					>view {
						display: flex;
						flex-direction: column;
						align-items: center;
						justify-content: center;
						width: 300rpx;
						font-size: 24rpx;
						color: #8C8C8C;
						margin-top: 16rpx;

						view {
							border-radius: 20rpx;
							background: #ccc;
							height: 180rpx;
							margin-bottom: 8rpx;
							width: 100%;

						}
					}
				}


			}

			.yyzz {
				padding: 24rpx 32rpx;
				border-radius: 20rpx;
				background: #fff;
				margin-top: 20rpx;

				view {
					height: 240rpx;
					margin-top: 20rpx;
					border-radius: 20rpx;
					border: 2rpx dashed #F4F6FA;
				}
			}

			.xgzz {
				padding: 24rpx 32rpx;
				border-radius: 20rpx;
				background: #fff;
				margin-top: 20rpx;

				>view {
					display: flex;
					flex-wrap: wrap;

					view {
						height: 200rpx;
						width: 32%;
						background: #ccc;
						margin-top: 16rpx;
						border-radius: 12rpx;
						margin-right: 2%;
					}

					>view:nth-of-type(3n) {
						margin-right: 0;
					}
				}
			}
		}

		.base {
			color: #8C8C8C;
			padding: 0 24rpx;
			margin-top: 24rpx;

			>view {
				border-radius: 20rpx;
				background: #fff;
				padding: 0 32rpx;
				margin-top: 20rpx;

				view {
					display: flex;
					padding: 24rpx 0;
					border-top: 1rpx solid #F4F6FA;

					text:nth-of-type(1) {
						color: #595959;
						width: 150rpx;
					}

					text:nth-of-type(2) {
						flex: 1;
						color: #262626;
					}
				}

				>viwe:nth-of-type(1) {
					border-top: none;
				}
			}
		}

		>.top {
			display: flex;
			flex-direction: column;
			align-items: center;
			padding: 48rpx 32rpx 24rpx 32rpx;
			background: #fff;

			.shz {
				font-size: 32rpx;
				color: #FF8C00;
			}

			.dd {
				color: #999999;

			}

			.tj {
				font-size: 36rpx;
				color: #111111;
				margin: 16rpx 0 4rpx 0;
			}

			view {
				width: 100%;
				display: flex;
				align-items: center;
				justify-content: space-between;
				color: #444444;
				margin-top: 56rpx;
			}

			>image {
				width: 120rpx;
			}
		}
	}
</style>